package com.htfyun.eink.pw.configs;

import android.graphics.Color;
import android.text.TextUtils;

import androidx.annotation.ColorInt;

import com.htfyun.eink.pw.draw.pen.PenRandomEraser;

public class ConfigPen {

    /**
     * 路径擦除的 stroke width. 其值大小, 会跟路径擦除的灵敏度有关;<br>
     * 没有设为 final, 是可以让用户自己设定.
     */
    public static float ERASER_PATH_STROKE_WIDTH = 10.0F;

    public static final float WRITER_STROKE_WIDTH_DEFAULT = 2.0F;
    public static final float ERASER_STROKE_WIDTH_DEFAULT = 30.0F;
    public static final int WRITER_COLOR_DEFAULT =  Color.BLACK;

    /**
     * 手写 pen id
     */
    private String writePenId;

    /**
     * 手写 颜色
     */
    @ColorInt
    private int writeColor = WRITER_COLOR_DEFAULT;

    /**
     * 手写 线宽
     */
    private float writeStrokeWidth = WRITER_STROKE_WIDTH_DEFAULT;

    /**
     * 擦除 penId
     */
    private String eraserPenId = null;

    /**
     * 笔帽 擦除 penId
     */
    private String eraserPenIdOfCap = PenRandomEraser.PEN_ID;
    /**
     * 笔帽 线宽
     */
    private float eraserStrokeWidth = ERASER_STROKE_WIDTH_DEFAULT;

    public String getWritePenId() {
        return writePenId;
    }

    public ConfigPen setWritePenId(String writePenId) {
        this.writePenId = writePenId;
        if (!TextUtils.isEmpty(writePenId)) {
            this.eraserPenId = null;
        }
        return this;
    }

    public int getWriteColor() {
        return writeColor;
    }

    public ConfigPen setWriteColor(int writeColor) {
        this.writeColor = writeColor;
        return this;
    }

    public float getWriteStrokeWidth() {
        return writeStrokeWidth;
    }

    public ConfigPen setWriteStrokeWidth(float writeStrokeWidth) {
        this.writeStrokeWidth = writeStrokeWidth;
        return this;
    }

    public String getEraserPenId() {
        return eraserPenId;
    }

    public ConfigPen setEraserPenId(String eraserPenId) {
        this.eraserPenId = eraserPenId;
        return this;
    }

    public String getEraserPenIdOfCap() {
        return eraserPenIdOfCap;
    }

    public ConfigPen setEraserPenIdOfCap(String eraserPenIdOfCap) {
        this.eraserPenIdOfCap = eraserPenIdOfCap;
        return this;
    }

    public float getEraserStrokeWidth() {
        return eraserStrokeWidth;
    }

    public ConfigPen setEraserStrokeWidth(float eraserStrokeWidth) {
        this.eraserStrokeWidth = eraserStrokeWidth;
        return this;
    }
}
